1 : <?php
2 : /*--------------------------------------------------------------------------+
3 : This file is part of eStudy.
4 : forum/classes/class.calendarautomation.inc.php
5 : - Modulgruppe: Calendar
6 : - Beschreibung: Automatisirungs-Klasse des Kalenders.
7 : - Version: 0.1, 02/24/2004
8 : - Autor(en): Benjamin Stadin <stadin@gmx.de>
9 : +---------------------------------------------------------------------------+
10 : This program is free software; you can redistribute it and/or
11 : modify it under the terms of the GNU General Public License
12 : as published by the Free Software Foundation; either version 2
13 : of the License, or any later version.
14 : +---------------------------------------------------------------------------+
15 : This program is distributed in the hope that it will be useful,
16 : but WITHOUT ANY WARRANTY; without even the implied warranty of
17 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 : GNU General Public License for more details.
19 : You should have received a copy of the GNU General Public License
20 : along with this program; if not, write to the Free Software
21 : Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 : +--------------------------------------------------------------------------*/
23 : /**
24 : * In dieser Datei wird die Klasse {@link SystemAutomation SystemAutomation} implementiert.
25 : * @package eStudy.Calendar
26 : * @subpackage Systemautomation
27 : * @author Benjamin Stadin <stadin@gmx.de>
28 : * @version 0.1 02/24/2004
29 : */
30 : /**Klasse einbinden um von ihr ableiten zu können*/
31 : require_once (PATH_TO_ROOT."common/classes/class.modulautomation.inc.php");
32 : /**
33 : * Automatisierung des Frameworks.
34 : * Die gesammten Automatisierten Funktionen des Frameworks werden von dieser Klasse
35 : * abgehandelt.
36 : * @package eStudy.Calendar
37 : * @subpackage Systemautomation
38 : * @author Benjamin Stadin <stadin@gmx.de>
39 : * @version 0.6 02/24/2004
40 : */
41 : class CalendarAutomation extends ModulAutomation {
42 : /**
43 : * Konstruktor
44 : * @access public
45 : */
46 : function CalendarAutomation() {
47 : //Kontruktor von Modulautomation aufrufen
48 1 : parent::ModulAutomation();
49 1 : $this->info = "Kalender";
50 1 : }
51 : /**
52 : * Ruft die Methoden auf, die automatisierte Funktionen ausführen, wenn ein
53 : * Student gelöscht wird. Im Forum werden Benutzer nicht gelöscht!
54 : * Deshalb Funktion ist jedoch lauffähig, falls erforderlich.
55 : *
56 : * @access public
57 : * @param integer $userID - die ID des Studenten
58 : * @return void
59 : */
60 : function deleteUser($userID) {
61 0 : global $db, $EZSQL_ERROR;
62 0 : if (is_numeric($userID)) {
63 0 : $userID = (int)$userID;
64 0 : $errorCount = count($EZSQL_ERROR);
65 0 : $result = $db->get_results("SELECT eventID FROM calendar_user WHERE userID='".$userID."'", ARRAY_A);
66 0 : if ( $result !== null ) {
67 0 : foreach( $result as $row ) {
68 0 : $db->query("DELETE FROM calendar WHERE eventid='".$row['eventID']."'");
69 0 : }
70 0 : }
71 0 : $db->query("DELETE FROM calendar_user WHERE userID='".$userID."'");
72 0 : if (count($EZSQL_ERROR) > $errorCount) return false;
73 0 : }
74 0 : return true;
75 : }
76 : }
|